import { httpPost } from '@/util/http'
import store from '@/store/index'

class Borrow {
  // 获取借单列表
  list(data) {
    return httpPost('/borrow/list', data)
  }
  // 获取未完成借单列表
  listStatus(data) {
    return httpPost('/borrow/list/status', data)
  }
  // 创建borrow
  put(data) {
    return httpPost(
      '/borrow/put',
      data,
      {
        contentType: 'application/json'
      },
      {
        sessionId: store.state.user.session_id
      }
    )
  }
}

export const borrow = new Borrow()
